package com.qc.blogsystemplus.mapper;

import com.qc.blogsystemplus.bean.CategoryBean;
import com.qc.blogsystemplus.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface CategoryMapper {

    @Select("SELECT id,category_name FROM category WHERE category_name = #{category_name}")
    CategoryBean getCagegory(String category_name);

    @Select("SELECT id,category_name FROM category")
    List<Category> getAllCategory();
}
